package com.yonyou.cyxdms.basedata.service.service.color;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yonyou.cyxdms.basedata.client.domains.vo.ColorCacheCMSVO;
import com.yonyou.cyxdms.basedata.client.domains.vo.ColorCacheVO;
import com.yonyou.cyxdms.basedata.client.domains.vo.ColorVO;
import com.yonyou.cyxdms.basedata.service.dto.CarInfoDTO;
import com.yonyou.cyxdms.basedata.service.dto.vehiclemodel.CarColorDTO;
import com.yonyou.cyxdms.basedata.service.dto.vehiclemodel.ColorImportDTO;
import com.yonyou.cyxdms.basedata.service.dto.vehiclemodel.ColorQueryDTO;
import com.yonyou.cyxdms.basedata.service.dto.vehiclemodel.GeneralCarColorDTO;
import com.yonyou.cyxdms.basedata.service.entity.color.ColorPO;
import com.yonyou.cyxdms.basedata.service.vo.CarInfoVO;
import com.yonyou.cyxdms.basedata.service.vo.CarparamColorVO;
import com.yonyou.cyxdms.basedata.service.vo.ExportMsgVO;
import com.yonyou.cyxdms.basedata.service.vo.color.ExteriorAndInteriorColorVO;
import com.yonyou.cyxdms.basedata.service.vo.color.PageColorVO;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * ColorService
 *
 * @author: guorp
 * @since: 2018/12/14
 * @updateDate:
 * @updateRemark:
 * @version:1.0 Copyright: Copyright (c) 2018
 */
public interface ColorService {
    /**
     * 根据packageId查询颜色
     *
     * @param packageId
     * @return java.util.List<com.yonyou.cyxdms.basedata.client.domains.DTO.basedata.CarColorDTO>
     * @author guorp
     * @since 2018/12/14
     */
    public List<ColorVO> getColorByPackageId(Long packageId);
    
    /**
     * 根据optionId查询颜色
     *
     * @param optionId
     * @return java.util.List<com.yonyou.cyxdms.basedata.client.domains.DTO.basedata.CarColorDTO>
     * @author zys
     * @since 2020/2/10
     */
    public List<ColorVO> getColorByPackageIdV2(Long optionId);

    /**
     * 按条件查询颜色信息
     *
     * @param queryParam 查询条件
     * @return java.util.List<com.yonyou.cyxdms.basedata.client.domains.DTO.basedata.ColorCacheVO>
     * @author renwd
     * @since 2018/12/18
     */
    List<ColorCacheVO> queryColorByCondition(Map<String, Object> queryParam);

    /**
     * 查询所有颜色
     *
     * @param
     * @return java.util.List<com.yonyou.cyxdms.basedata.client.domains.dto.basedata.CarColorDTO>
     * @author renwd
     * @since 2019/2/28
     */
    List<ColorVO> listColor();

    /**
     * 根据车系id或车型id或配置id或颜色id查询车型信息
     *
     * @param queryParam
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.CarInfoVO>
     * @author renwd
     * @since 2019/6/25
     */
    CarInfoVO selectCarInfoByCondition(CarInfoDTO queryParam);

    //根据车系Id检索车型颜色列表
    public List<CarparamColorVO> queryCarColor(Long carId);

    //根据车型Id  颜色Id 检索指导价格
    public Double queryPrice(Long carId, Integer colorId);

    /**
     * 分页查询车辆颜色
     *
     * @param page
     * @param colorQueryDTO
     * @author Tansj
     * @since 2019/11/18
     */
    IPage<PageColorVO> queryColor(Page page, ColorQueryDTO colorQueryDTO);

    /**
     * 分页查询Dcs车辆颜色
     *
     * @param page
     * @param colorQueryDTO
     * @author Tansj
     * @since 2019/11/18
     */
    IPage<PageColorVO> queryDcsColor(Page page, ColorQueryDTO colorQueryDTO);

    /**
     * 修改颜色
     *
     * @param id
     * @param colorDto
     * @return java.lang.Integer
     * @author renwd
     * @since 2019/7/17
     */
    Integer updateColor(Long id, CarColorDTO colorDto);

    /**
     * Dcs修改颜色
     *
     * @param id
     * @param colorDto
     * @return java.lang.Integer
     * @author lijun
     * @since 2019/7/17
     */
    Integer updateDcsColor(Long id, CarColorDTO colorDto);

    /**
     * 新增颜色
     *
     * @param carColorDTO
     * @return java.lang.Integer
     * @author renwd
     * @since 2019/7/17
     */
    Integer addColor(CarColorDTO carColorDTO);

    /**
     * Dcs新增颜色
     *
     * @param carColorDTO
     * @return java.lang.Integer
     * @author lijun
     * @since 2019/7/17
     */
    Integer addDcsColor(CarColorDTO carColorDTO);

    /**
     * 查询外饰内饰
     *
     * @param queryParam
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.color.ExteriorAndInteriorColorVO>
     * @author renwd
     * @since 2019/7/18
     */
    List<ExteriorAndInteriorColorVO> selectExteriorColorInfo(Map<String, Object> queryParam);


    /**
     * 根据code查询颜色
     *
     * @param appId
     * @param colorCode
     * @return com.yonyou.cyxdms.basedata.service.entity.color.ColorPO
     * @author lijun
     * @since 2019/9/12
     */
    ColorPO getByCode(String appId, String colorCode);

    /**
     * 通用-新增/更新颜色
     *
     * @author：chenzb
     * @since：2019-10-12
     */
    void addColorGeneral(List<GeneralCarColorDTO> generalCarColorDto);

    List<ColorCacheVO> getAllColorByAppIdAndType(String appId, Integer colorType);

    List<ColorCacheCMSVO> queryColorByConditionCms(Map<String, Object> queryParam);

    /**
     * 颜色导入模板下载
     *
     * @return void
     * @author caozx
     * @since 2020/12/10
     */
    void export(HttpServletResponse response) throws IOException;

    /**
     * 颜色导入
     *
     * @return void
     * @author caozx
     * @since 2020/12/10
     */
    Map<String,List<ExportMsgVO>> upload(MultipartFile file);
}
